﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
	CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
	<script type="text/javascript">
		$(document).ready(function () {
			$("#filterInput").bind("input", function () {
				var keywords = $(this).val();
				if (keywords.length == 0) {
					$(".result").show();
					return;
				}
				keywords = keywords.split(",");
				$(".result").each(function () {
					var date = $(this).find("#date").text().toLowerCase();
					var name = $(this).find('.resultInfo').find('#name').text().toLowerCase();
					var description = $(this).find('.resultInfo').find('#description').text().toLowerCase();
					var matchesKeywords = true;
					for (var keyIndex in keywords) {
						var keyword = keywords[keyIndex].toLowerCase().replace(/^\s+|\s+$/g, '');
						if (keyword.length == 0) continue;
						if (!((date.indexOf(keyword) > -1) || (name.indexOf(keyword) > -1) || (description.indexOf(keyword) > -1))) {
							matchesKeywords = false;
							break;
						}
					}
					matchesKeywords ? $(this).show() : $(this).hide();
				});
			});
		});
	</script>
	<script type="text/javascript" src="Scripts/reserve.js"></script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
	<div class="reservation-popup">
		<div class="background"></div>
		<div class="head gBlack">
			<div class="title">Reservation</div>
			<div class="x" onclick="hide_reserve();">x</div>
		</div>
		<div class="content">
			<div class="movie-desc">
				<img class="avatar" src="http://songbliss.com/img/notific-icon.png" />
				<div class="movie-name">Pulp Fiction 20:00</div>
			</div>
			<div class="separator"></div>
			<div class="inputs">
				<div class="label name-label">Name:</div>
				<input class="name-input" type="text" />
				<div class="label phone-label">Phone:</div>
				<input class="phone-input" type="text" />
			</div>
			<div class="separator"></div>
			<div class="seat-table"><img src="Styles/images/loading.gif" /></div>
			<div class="separator"></div>
			<div class="buyButton gRed submit-btn" onclick="return submit_reservation();">Reserve</div>
		</div>
	</div>
	<div class="searchWrap">
			<span class="fBlack">Filter: </span>
			<input id="filterInput" type="text" class="searchInput" placeholder="e.g. Pulp Fiction, 7/10/2011" />
		</div>
		
		<div class="resultsWrap fBlack">
			<%  
				this.printSchedulesList();
			%>
		</div>
</asp:Content>